package com.ruoyi.yipaiju;

import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Order(10)
public class YipaijuSystemApplication implements ApplicationRunner {

    @Autowired
    private ISysUserService sysUserService;
    @Autowired
    private RedisCache redisCache;

    @Override
    @Async
    public void run(ApplicationArguments args) throws Exception {
        while (true){
            try {
                Thread.sleep(30000);
                sysUserService.selectUserById(1L);
                redisCache.getCacheObject("sys_config:sys.account.captchaEnabled");
            }catch (Exception e){
//                e.printStackTrace();
            }
        }
    }
}
